import { DataNode } from 'antd/lib/tree';

const G120TreeData = (state) => {
  const treeDataG120: DataNode[] = [
    {
      title: '设备名称',
      key: 'libG120-0.0',
      a: true,
      children: [
        {
          title: '客户设备名称',
          key: 'libG120-0.0-0',
          a: true,
        },
        {
          title: '非客户设备名称',
          key: 'libG120-0.0-1',
          a: true,
        },
      ]
    },
    {
      title: '轴名称',
      key: 'libG120-0',
      a: true,
    },
    {
      title: '负载类型',
      key: 'libG120-1',
    },
    {
      title: '机械结构',
      key: 'libG120-2',
    },
    {
      title: '驱动类型',
      key: 'libG120-31',
      a: true,
    },
    {
      title: '控制单元硬件标识符',
      key: 'libG120-32',
      a: true,
    },
    {
      title: '硬件标识符',
      key: 'libG120-33',
      a: true,
    },
    {
      title: '驱动轴号',
      key: 'libG120-34',
      a: true,
    },
    {
      title: '从轴选择',
      key: 'libG120-35',
      a: true,
    },
    {
      title: '驱动数据组数量',
      key: 'libG120-36',
      a: true,
    },
    {
      title: '驱动配置',
      key: 'libG120-3',
      a: true,
      children: [
        {
          title: '驱动进线电压 P210',
          key: 'libG120-3-01'
        },
        {
          title: '驱动应用级 P96',
          key: 'libG120-3-02'
        },
        {
          title: '驱动数据组数量 P180',
          key: 'libG120-3-03'
        },

        {
          title: '控制报文 P922',
          key: 'libG120-3-0'
        },
        {
          title: '附加报文 P8864',
          key: 'libG120-3-1'
        },
        {
          title: '控制模式 P1300',
          key: 'libG120-3-2'
        },
        {
          title: '电流限制值 P640 [Arms]',
          key: 'libG120-3-31',
        },
        {
          title: '参考转速 P2000 [rpm]',
          key: 'libG120-3-32',
        },
        {
          title: '参考电流 P2002 [Arms]',
          key: 'libG120-3-33',
        },
        {
          title: '参考转矩 P2003 [Nm]',
          key: 'libG120-3-34',
        },
        {
          title: '转矩限幅值',
          key: 'libG120-3-3',
          children: [
            {
              title: '上限值 P1520 [Nm]',
              key: 'libG120-3-3-0',
            },
            {
              title: '下限值 P1521 [Nm]',
              key: 'libG120-3-3-1',
            },
          ]
        },
        {
          title: '抱闸配置',
          key: 'libG120-3-4',
          children: [
            {
              title: '抱闸',
              key: 'libG120-3-4-01',
            },
            {
              title: '抱闸配置 P1215',
              key: 'libG120-3-4-0',
            },
            {
              title: '抱闸打开时间 P1216 [ms]',
              key: 'libG120-3-4-1',
            },
            {
              title: '抱闸闭合时间 P1217 [ms]',
              key: 'libG120-3-4-2',
            },
            {
              title: '制动电阻制动功率 P219 [kW]',
              key: 'libG120-3-4-31',
            },
            {
              title: '再生方式功率极限 P1531 [kW]',
              key: 'libG120-3-4-32',
            },
            {
              title: '制动控制诊断分析 P1278',
              key: 'libG120-3-4-3',
            },
            {
              title: '启动频率 P1351 [%]',
              key: 'libG120-3-4-4',
            },
            {
              title: '抱闸控制输出DO',
              key: 'libG120-3-4-5',
            },
          ]
        },
      ]
    },
    {
      title: '电机配置数据',
      key: 'libG120-4',
      a: true,
      children: [
        {
          title: '连接类型 P133.0',
          key: 'libG120-4-0'
        },
        {
          title: '87Hz运行选择 P133.1',
          key: 'libG120-4-1'
        },
        {
          title: '电机订货号',
          key: 'libG120-4-2'
        },
        {
          title: '最大转速 P1082 [rpm]',
          key: 'libG120-4-3'
        },
        {
          title: '电机方向 P1820',
          key: 'libG120-4-4'
        },
      ]
    },
    {
      title: '编码器配置',
      key: 'libG120-5',
      a: true,
      children: [
        {
          title: '编码器1配置',
          key: 'libG120-5-0',
          children: [
            {
              title: '编码器1接口 P420[0]',
              key: 'libG120-5-0-01',
            },
            {
              title: '编码器1型号',
              key: 'libG120-5-0-5',
            },
            {
              title: '编码器1类型',
              key: 'libG120-5-0-0',
            },
            {
              title: '编码器转数',
              key: 'libG120-5-0-3',
            },
            {
              title: '电机转数',
              key: 'libG120-5-0-4',
            },
            {
              title: '转速实际值取反 P410[0].00',
              key: 'libG120-5-0-1',
            },
            {
              title: '位置实际值取反 P410[0].01',
              key: 'libG120-5-0-2',
            },
          ],
        },
        {
          title: '编码器2配置',
          key: 'libG120-5-1',
          children: [
            {
              title: '编码器2选择',
              key: 'libG120-5-1-0',
            },
            {
              title: '编码器2接口 P420[1]',
              key: 'libG120-5-1-11',
            },
            {
              title: '编码器2型号',
              key: 'libG120-5-1-6',
            },
            {
              title: '编码器2类型',
              key: 'libG120-5-1-1',
            },
            {
              title: '编码器转数',
              key: 'libG120-5-1-4',
            },
            {
              title: '电机转数',
              key: 'libG120-5-1-5',
            },
            {
              title: '转速实际值取反 P410[1].00',
              key: 'libG120-5-1-2',
            },
            {
              title: '位置实际值取反 P410[1].01',
              key: 'libG120-5-1-3',
            },
          ],
        },
      ],
    },
    {
      title: '工艺参数',
      key: 'libG120-6',
      a: true,
      children: [
        {
          title: 'EPOS',
          key: 'libG120-6-0',
          children: [
            {
              title: '定位编码器 P2502',
              key: 'libG120-6-0-0'
            },
            {
              title: '电机转数 P2504',
              key: 'libG120-6-0-1'
            },
            {
              title: '负载转数 P2505',
              key: 'libG120-6-0-2'
            },
            {
              title: '10mm对应的LU (EPOS) P2503',
              key: 'libG120-6-0-3'
            },
            {
              title: '负载一圈的距离 [mm]',
              key: 'libG120-6-0-41'
            },
            {
              title: '每转LU (EPOS) P2506',
              key: 'libG120-6-0-4'
            },
            {
              title: '位置设定值滤波器时间常数 (EPOS) P2533 [ms]',
              key: 'libG120-6-0-5'
            },
            {
              title: '位置环增益 (EPOS) P2538',
              key: 'libG120-6-0-6'
            },
            {
              title: '位置环积分时间 (EPOS) P2539',
              key: 'libG120-6-0-7'
            },
            {
              title: '速度前馈系数 (EPOS) P2534',
              key: 'libG120-6-0-8'
            },
            {
              title: 'EPOS 最大速度 P2571 [m/min]',
              key: 'libG120-6-0-9'
            },
            {
              title: 'EPOS 最大加速度 P2572 [m/s²]',
              key: 'libG120-6-0-10'
            },
            {
              title: 'EPOS 最大减速度 P2573 [m/s²]',
              key: 'libG120-6-0-11'
            },
            {
              title: 'EPOS 急动限制 P2574 [m/s³]',
              key: 'libG120-6-0-12'
            },
            {
              title: 'EPOS 急动限制激活 P2575',
              key: 'libG120-6-0-13'
            },
            {
              title: 'LR 输出速度极限 P2540',
              key: 'libG120-6-0-14'
            },
            {
              title: 'Jog1速度 (EPOS) P2585 [m/min]',
              key: 'libG120-6-0-15'
            },
            {
              title: 'Jog2速度 (EPOS) P2586 [m/min]',
              key: 'libG120-6-0-16'
            },
            {
              title: '正软限位开关 (EPOS) p2580 [mm]',
              key: 'libG120-6-0-171'
            },
            {
              title: '负软限位开关 (EPOS) p2581 [mm]',
              key: 'libG120-6-0-172'
            },
            {
              title: '静态窗口 P2542',
              key: 'libG120-6-0-17'
            },
            {
              title: '静态监控时间 P2543 [ms]',
              key: 'libG120-6-0-18'
            },
            {
              title: '定位窗口 P2544',
              key: 'libG120-6-0-19'
            },
            {
              title: '定位监控时间 P2545 [ms]',
              key: 'libG120-6-0-20'
            },
            {
              title: '动态监控公差 P2546 [LU]',
              key: 'libG120-6-0-21'
            },
            {
              title: 'STOP凸轮',
              key: 'libG120-6-0-22',
              children: [
                {
                  title: '需要激活修改参数',
                  key: 'libG120-6-0-22-0'
                },
                {
                  title: '负向 P2569',
                  key: 'libG120-6-0-22-1'
                },
                {
                  title: '正向 P2570',
                  key: 'libG120-6-0-22-2'
                },
              ],
            },
          ],
        },
        {
          title: 'Speed',
          key: 'libG120-6-1',
          children: [
            {
              title: '速度环增益 (Speed) P1460',
              key: 'libG120-6-1-0',
            },
            {
              title: '速度环积分时间 (Speed) P1462',
              key: 'libG120-6-1-1',
            },
            {
              title: 'RFG上升时间 (Speed) P1120 [s]',
              key: 'libG120-6-1-2',
            },
            {
              title: 'RFG下降时间 (Speed) P1121 [s]',
              key: 'libG120-6-1-3',
            },
            {
              title: 'RFG开始端平滑时间 P1130 [s]',
              key: 'libG120-6-1-4',
            },
            {
              title: 'RFG结束端平滑时间 P1131 [s]',
              key: 'libG120-6-1-5',
            },
            {
              title: 'OFF3斜坡下降时间 P1135 [s]',
              key: 'libG120-6-1-6',
            },
            {
              title: '加速度前馈定标 P1496',
              key: 'libG120-6-1-7',
            },
            {
              title: 'Kp适配速度上限比例系数 P1461 [%]',
              key: 'libG120-6-1-8',
            },
            {
              title: 'Tn适配速度上限比例系数 P1463 [%]',
              key: 'libG120-6-1-9',
            },
            {
              title: '适配转速下限 P1464 [rpm]',
              key: 'libG120-6-1-10',
            },
            {
              title: '适配转速上限 P1465 [rpm]',
              key: 'libG120-6-1-11',
            },
          ],
        },
      ],
    },
  ];

  return treeDataG120.filter((item) => item[state] == true);
};

export default G120TreeData;
